﻿#include "FITKAcousticsMaterialsFoam.h"

namespace Acoustics
{
    FITKAcousticsAbsMaterial::AcousticsMaterialType FITKAcousticsMaterialsFoam::getAcousticsMaterialType()
    {
        return FITKAcousticsAbsMaterial::AcousticsMaterialType::Foam;
    }

    double FITKAcousticsMaterialsFoam::getTensileModulus() const
    {
        return _tensileModulus;
    }

    void FITKAcousticsMaterialsFoam::setTensileModulus(double tensileModulus)
    {
        _tensileModulus = tensileModulus;
    }

    double FITKAcousticsMaterialsFoam::getshearModulus() const
    {
        return _shearModulus;
    }

    void FITKAcousticsMaterialsFoam::setshearModulus(double shearModulus)
    {
        _shearModulus = shearModulus;
    }

    double FITKAcousticsMaterialsFoam::getFlowResistivity() const
    {
        return _flowResistivity;
    }

    void FITKAcousticsMaterialsFoam::setFlowResistivity(double flowResistivity)
    {
        _flowResistivity = flowResistivity;
    }

    double FITKAcousticsMaterialsFoam::getPoissonRatio() const
    {
        return _poissonRatio;
    }

    void FITKAcousticsMaterialsFoam::setPoissonRatio(double poissonRatio)
    {
        _poissonRatio = poissonRatio;
    }

    double FITKAcousticsMaterialsFoam::getLossFactor() const
    {
        return _lossFactor;
    }

    void FITKAcousticsMaterialsFoam::setLossFactor(double lossFactor)
    {
        _lossFactor = lossFactor;
    }

    double FITKAcousticsMaterialsFoam::getPorosity() const
    {
        return _porosity;
    }

    void FITKAcousticsMaterialsFoam::setPorosity(double porosity)
    {
        _porosity = porosity;
    }

    double FITKAcousticsMaterialsFoam::getTortuosity() const
    {
        return _tortuosity;
    }

    void FITKAcousticsMaterialsFoam::setTortuosity(double tortuosity)
    {
        _tortuosity = tortuosity;
    }

    double FITKAcousticsMaterialsFoam::getThermalLength() const
    {
        return _thermalLength;
    }

    void FITKAcousticsMaterialsFoam::setThermalLength(double thermalLength)
    {
        _thermalLength = thermalLength;
    }

    double FITKAcousticsMaterialsFoam::getViscousLength() const
    {
        return _viscousLength;
    }

    void FITKAcousticsMaterialsFoam::setViscousLength(double viscousLength)
    {
        _viscousLength = viscousLength;
    }

    bool FITKAcousticsMaterialsFoam::copy(Core::FITKAbstractDataObject *obj)
    {
        //转换强制类型
        Acoustics::FITKAcousticsMaterialsFoam* data = dynamic_cast<Acoustics::FITKAcousticsMaterialsFoam*>(obj);

        if(nullptr == data)//判断是否转换成功
        {
            return false;
        }
        //复制成员变量
        _tensileModulus = data->getTensileModulus();
        _shearModulus = data->getshearModulus();
        _flowResistivity = data->getFlowResistivity();
        _poissonRatio = data->getPoissonRatio();
        _lossFactor = data->getLossFactor();
        _porosity = data->getPorosity();
        _tortuosity = data->getTortuosity();
        _thermalLength = data->getThermalLength();
        _viscousLength = data->getViscousLength();

        // 调用父类的方法
        Acoustics::FITKAcousticsAbsMaterial::copy(obj);
        return true;
    }
}
